home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 March / EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso / earcd / grafica / amhelios / ray_cast.h < prev    next >
C/C++ Source or Header  |  1999-01-01  |  2KB  |  72 lines

  1. ////////////////////////////////////////////////////////////
  2. //
  3. //  RAY_CAST.H - Ray Cast Form Factor Class
  4. //
  5. //  Version:    1.03A
  6. //
  7. //  History:    94/08/23 - Version 1.00A release.
  8. //              94/12/16 - Version 1.01A release.
  9. //              95/02/05 - Version 1.02A release.
  10. //              95/07/21 - Version 1.02B release.
  11. //              96/02/14 - Version 1.02C release.
  12. //              96/04/01 - Version 1.03A release.
  13. //
  14. //  Compilers:  Microsoft Visual C/C++ Professional V1.5
  15. //              Borland C++ Version 4.5
  16. //
  17. //  Author:     Ian Ashdown, P.Eng.
  18. //              byHeart Software Limited
  19. //              620 Ballantree Road
  20. //              West Vancouver, B.C.
  21. //              Canada V7S 1W3
  22. //              Tel. (604) 922-6148
  23. //              Fax. (604) 987-7621
  24. //
  25. //  Copyright 1994-1996 byHeart Software Limited
  26. //
  27. //  The following source code has been derived from:
  28. //
  29. //    Ashdown, I. 1994. Radiosity: A Programmer's
  30. //    Perspective. New York, NY: John Wiley & Sons.
  31. //
  32. //  It may be freely copied, redistributed, and/or modified
  33. //  for personal use ONLY, as long as the copyright notice
  34. //  is included with all source code files.
  35. //
  36. ////////////////////////////////////////////////////////////
  37.  
  38. #ifndef _RAY_CAST_H
  39. #define _RAY_CAST_H
  40.  
  41. #include "parse.h"
  42.  
  43. // Maximum number of rays to be cast
  44. static const int RC_NumRays = 4;
  45.  
  46. class RayCast   // Ray cast form factor determination
  47. {
  48.   private:
  49.     double ray_area;            // Intersection area
  50.     double src_area;            // Source patch area
  51.     double selector;            // Triangle selector
  52.     Patch3 *psrc;               // Source patch pointer
  53.     Patch3 *pcache;             // Last occluding patch
  54.     Vector3 end;                // Intersection vector
  55.     Vector3 ray_dir;            // Ray direction
  56.     Vector3 src_center;         // Source patch center
  57.     Vector3 src_norm;           // Source patch normal
  58.     Vector3 start;              // Receiver vertex vector
  59.     Vector3 v0, v1, v2, v3;     // Vertex vectors
  60.  
  61.     void Select( Vector3 * );
  62.     BOOL CheckOcclusion( Instance * );
  63.     BOOL TestPatch( Patch3 * );
  64.  
  65.   public:
  66.     void Init( Patch3 * );
  67.     double CalcFormFactor( Vertex3 *, Instance * );
  68. };
  69.  
  70. #endif
  71.  
  72.